'use strict';
angular.module('gkwb')
    .config(['$stateProvider', '$urlRouterProvider', '$httpProvider',function ($stateProvider, $urlRouterProvider, $httpProvider) {
        $httpProvider.defaults.useXDomain = true;
        delete $httpProvider.defaults.headers.common['X-Requested-With'];

        //
        // For any unmatched url, redirect to /state1
        $urlRouterProvider.otherwise("/login");
        //
        // Now set up the states
        $stateProvider
            //报名卡管理 -- 开始 -- 
            .state('sc', {
                url: "/sc",
                abstract: true,
                templateUrl: "pages/sc.html",
            })
            .state('sc.list', {
                url: "/list",
                templateUrl: "pages/sc.list.html",
                controller:'SignCardListCtrl'
            })
            .state('sc.create', {
                url: "/create",
                templateUrl: "pages/sc.create.html",
                controller:'SignCardCtrl'
            })
            //报名卡管理 -- 结束 -- 
            .state('main', {
                abstract: true,
                url: "/main",
                templateUrl: "pages/main.html"
            })
            .state('main.monitor', {
                url: "/monitor",
                templateUrl: "pages/main.monitor.html",
                controller:'MonitorCtrl'
            })
            .state('main.setting', {
                url: "/promise",
                templateUrl: "pages/main.setting.html",
                controller:'SettingCtrl'
            })
            .state('main.order', {
                url: "/order",
                templateUrl: "pages/main.order.html",
                controller:'OrderCtrl'
            })
            .state('main.ks', {
                url: "/ks",
                templateUrl: "pages/main.ks.html",
                controller:'KSCtrl'
            })
            .state('main.complete', {
                url: "/complete",
                templateUrl: "pages/main.complete.html"
            })
            //机构管理 -- 开始 -- 
            .state('group', {
                abstract: true,
                url: "/group",
                templateUrl: "pages/group.html"
            })
            .state('group.signpoint', {
                url: "/signpoint",
                templateUrl: "pages/group.signpoint.html",
                controller:'SignPointCtrl'
            })
            //机构管理 -- 结束 -- 
            .state('dashboard', {
                abstract: true,
                url: "/dashboard",
                templateUrl: "pages/dashboard.html"
            })
            .state('dashboard.signpoint', {
                url: "/sp",
                templateUrl: "pages/dashboard.sp.html",
                controller:'DBSPCtrl'
            })
            .state('dashboard.region', {
                url: "/region",
                templateUrl: "pages/dashboard.region.html",
                controller:'DashboardCtrl'
            })
            .state('dashboard.city', {
                url: "/city",
                templateUrl: "pages/dashboard.city.html",
                controller:'DashboardCtrl'
            })
            .state('dashboard.prov', {
                url: "/prov",
                templateUrl: "pages/dashboard.prov.html",
                controller:'DashboardCtrl'
            })
            .state('login', {
                url: "/login",
                templateUrl: "login.html",
                controller:'LoginCtrl'
            })
            .state('modifyPassword', {
                url: "/modifypwd",
                templateUrl: "modifypwd.html",
                params:{pwd:null},
                controller:'modifyPasswordCtrl'
            })
            .state('home', {
                url: "/home",
                templateUrl: "pages/home.html",
                controller:'HomeCtrl'
            });
    }])